AccountCategory:

<?php
function showaccount($name,$code,$at,$accode)
{
  echo "
<br>&nbsp;&nbsp;$code:
<br>&nbsp;&nbsp;&nbsp;&nbsp;name: $name
<br>&nbsp;&nbsp;&nbsp;&nbsp;code: $code
<br>&nbsp;&nbsp;&nbsp;&nbsp;AccountType: $at
";
if($accode)echo "
<br>&nbsp;&nbsp;&nbsp;&nbsp;parent_code: $accode
";

}


$asset="
0	ASSETS
1	CURRENT ASSETS
2	CASH
3	Cash on Hand
3	Cash in National Treasury
3	Cash in Bank - Local Currency
3	Cash in Bank - Foreign Currency
2	RECEIVABLES
3	Receivable Accounts
3	Inter-Agency Receivables
3	Intra-Agency Receivables
3	Other Receivables
2	INVENTORIES
3	Materials
3	Supplies
3	Agricultural, Fishery and Forestry Products
2	PREPAYMENTS
2	OTHER CURRENT ASSETS
1	INVESTMENTS
2	INVESTMENTS IN SECURITIES
2	SINKING FUND
1	PROPERTY, PLANT AND EQUIPMENT
2	LAND AND LAND IMPROVEMENTS
2	ppe_BUILDINGS
2	ppe_LEASEHOLD IMPROVEMENTS
2	ppe_OFFICE EQUIPMENT, FURNITURE AND FIXTURES
2	ppe_MACHINERIES AND EQUIPMENT
2	ppe_TRANSPORTATION EQUIPMENT
2	ppe_OTHER PROPERTY, PLANT AND EQUIPMENT
2	ppe_PUBLIC INFRASTRUCTURES
2	ppe_REFORESTATION PROJECTS
2	CONSTRUCTION IN PROGRESS
3	Agency Assets
3	Public Infrastructures/Reforestation Projects
1	OTHER ASSETS
";

$liability="
0	LIABILITIES
1	CURRENT LIABILITIES
2	Payable Accounts
2	Inter - Agency Payables
2	Intra - Agency Payables
2	Other Liability Accounts
1	LONG - TERM LIABILITIES
2	Mortgage/Bonds/Loans Payable
1	DEFERRED CREDITS
";
$equity="
0	EQUITY
1	GOVERNMENT EQUITY
1	INTERMEDIATE ACCOUNTS
";
$income="
0	INCOME
1	TAX REVENUE
2	National Taxes
2	Local Taxes
1	GENERAL INCOME ACCOUNTS
2	Permits and Licenses
2	Service Income
2	Business Income
2	Subsidy Income
2	Other Income
1	GAIN/LOSS ACCOUNTS
";
$expense="
0	EXPENSES
1	PERSONAL SERVICES
2	Salaries and Wages
2	Other Compensation
2	Personnel Benefits Contributions
2	Other Personnel Benefits
1	MAINTENANCE AND OTHER OPERATING EXPENSES
2	Traveling Expenses
2	Training and Scholarship Expenses
2	Supplies and Materials Expenses
2	Utility Expenses
2	Communication Expenses
2	Professional Services
2	Repairs and Maintenance
3	rm_Land Improvements
3	rm_Buildings
3	rm_Leasehold Improvements
3	rm_Office Equipment, Furniture and Fixtures
3	rm_Machineries and Equipment
3	rm_Transportation Equipment
3	rm_Other Property, Plant and Equipment
3	rm_Public Infrastructures
3	rm_Reforestation Projects
2	Subsidies and Donations
2	Confidential, Intelligence, Extraordinary and Miscellaneous Expenses
2	Taxes, Insurance Premiums and Other Fees
2	Non-Cash Expenses
3	Bad Debts
3	Depreciation
4	d_Land Improvements
4	d_Buildings
4	d_Leasehold Improvements
4	d_Office Equipment, Furniture and Fixtures
4	d_Machineries and Equipment
4	d_Transportation Equipment
4	d_Other Property, Plant and Equipment
2	Depletion
3	Obsolescence - IT Software
2	Discounts
2	Tax Exemptions and Refunds
2	Remittance to National Treasury from Assets Disposal
2	Other Maintenance and Operating Expenses
1	FINANCIAL EXPENSES

";

$l0="";
$l1="";
$l2="";
$l3="";
$l4="";

class CodeMgr
{
  private $l0="";
  private $l1="";
  private $l2="";
  private $l3="";
  private $l4="";
  function getparentcode($level)
  {
    switch($level)
    {
      case 4:
        return $this->l3;
        break;
      case 3:
        return $this->l2;
        break;
      case 2:
        return $this->l1;
        break;
      case 1:
        return $this->l0;
        break;
      case 0:
        return "";
        break;
    }
  }
  function setparentcode($level,$code)
  {
    switch($level)
    {
      case 4:
        $this->l4=$code;
        break;
      case 3:
        $this->l4="";
        $this->l3=$code;
        break;
      case 2:
        $this->l4="";
        $this->l3="";
        $this->l2=$code;
        break;
      case 1:
        $this->l4="";
        $this->l3="";
        $this->l2="";
        $this->l1=$code;
        break;
      case 0:
        $this->l4="";
        $this->l3="";
        $this->l2="";
        $this->l1="";
        $this->l0=$code;
        break;
    }
  }
}

$codearray=array();

$codemgr=new CodeMgr();
$accode="";
$string=$asset;
$string=str_replace("","",$string);
$array=explode("\n",$string);
foreach($array as &$item)
{
  $item=trim($item);
  if(!$item)continue;
  $pieces=explode("\t",$item);
  $level=$pieces[0];
  $name=$pieces[1];
  $code=strtolower(str_replace(array(",","-"," ","/"),"",$name));
  $at="at_asset";

  $codemgr->setparentcode($level,$code);

  showaccount($name,$code,$at,$codemgr->getparentcode($level));
  if(!array_key_exists($code,$codearray))
    $codearray[$code]=$code;
  else
    echo "duplicate: ".$code."<br>";
}

$accode="";
$string=$liability;
$string=str_replace("","",$string);
$array=explode("\n",$string);
foreach($array as &$item)
{
  $item=trim($item);
  if(!$item)continue;
  $pieces=explode("\t",$item);
  $level=$pieces[0];
  $name=$pieces[1];
  $code=strtolower(str_replace(array(",","-"," ","/"),"",$name));
  $at="at_liability";

  $codemgr->setparentcode($level,$code);

  showaccount($name,$code,$at,$codemgr->getparentcode($level));
  if(!array_key_exists($code,$codearray))
    $codearray[$code]=$code;
  else
    echo "duplicate: ".$code."<br>";
}
$accode="";
$string=$equity;
$string=str_replace("","",$string);
$array=explode("\n",$string);
foreach($array as &$item)
{
  $item=trim($item);
  if(!$item)continue;
  $pieces=explode("\t",$item);
  $level=$pieces[0];
  $name=$pieces[1];
  $code=strtolower(str_replace(array(",","-"," ","/"),"",$name));
  $at="at_equity";

  $codemgr->setparentcode($level,$code);

  showaccount($name,$code,$at,$codemgr->getparentcode($level));
  if(!array_key_exists($code,$codearray))
    $codearray[$code]=$code;
  else
    echo "duplicate: ".$code."<br>";
}
$accode="";
$string=$income;
$string=str_replace("","",$string);
$array=explode("\n",$string);
foreach($array as &$item)
{
  $item=trim($item);
  if(!$item)continue;
  $pieces=explode("\t",$item);
  $level=$pieces[0];
  $name=$pieces[1];
  $code=strtolower(str_replace(array(",","-"," ","/"),"",$name));
  $at="at_income";

  $codemgr->setparentcode($level,$code);

  showaccount($name,$code,$at,$codemgr->getparentcode($level));
  if(!array_key_exists($code,$codearray))
    $codearray[$code]=$code;
  else
    echo "duplicate: ".$code."<br>";
}
$accode="";
$string=$expense;
$string=str_replace("","",$string);
$array=explode("\n",$string);
foreach($array as &$item)
{
  $item=trim($item);
  if(!$item)continue;
  $pieces=explode("\t",$item);
  $level=$pieces[0];
  $name=$pieces[1];
  $code=strtolower(str_replace(array(",","-"," ","/"),"",$name));
  $at="at_expense";

  $codemgr->setparentcode($level,$code);

  showaccount($name,$code,$at,$codemgr->getparentcode($level));
  if(!array_key_exists($code,$codearray))
    $codearray[$code]=$code;
  else
    echo "duplicate: ".$code."<br>";
}
//echo "<pre>";
//var_dump($codearray);
?>
<br>
<br>Account:

<?php
function showaccount2($name,$code,$at,$accode)
{
  echo "
<br>&nbsp;&nbsp;$code:
<br>&nbsp;&nbsp;&nbsp;&nbsp;name: $name
<br>&nbsp;&nbsp;&nbsp;&nbsp;code: $code
<br>&nbsp;&nbsp;&nbsp;&nbsp;AccountType: $at
<br>&nbsp;&nbsp;&nbsp;&nbsp;account_category_code: $accode
";
}


$asset="
ASSETS  	
CURRENT ASSETS	
CASH	
Cash on Hand	
101	Cash in Vault
102	Cash - Collecting Officers
103	Cash - Disbursing Officers
104	Petty Cash Fund
Cash in National Treasury	
108	Cash - National Treasury, Modified Disbursements System (MDS)
Cash in Bank - Local Currency	
110	Cash - Bangko Sentral ng Pilipinas
111	Cash in Bank - Local Currency, Current Account
112	Cash in Bank - Local Currency, Savings Account
113	Cash in Bank - Local Currency, Time Deposits
Cash in Bank - Foreign Currency	
114	Cash - Bangko Sentral ng Pilipinas
115	Cash in Bank - Foreign Currency, Current Account
116	Cash in Bank - Foreign Currency, Savings Account
117	Cash in Bank - Foreign Currency, Time Deposits
	
RECEIVABLES	
Receivable Accounts	
121	Accounts Receivable
301	Allowance for Doubtful Accounts
122	Notes Receivable
123	Due from Officers and Employees
124	Loans Receivable - GOCCs
125	Loans Receivable - LGUs
126	Loans Receivable - Others
127	Real Property Tax Receivable
128	Special Education Tax Receivable
129	Interests Receivable
130	Currency Swap Receivable
Inter-Agency Receivables	
131	Due from National Treasury
136	Due from NGAs
137	Due from GOCCs
138	Due from LGUs
139	Due from NGOs/POs
Intra-Agency Receivables	
141	Due from Central Office
142	Due from Regional Offices/Staff Bureaus
143	Due from Operating Units
144	Due from Other Funds
Other Receivables	
146	Receivables - Disallowances/Charges
149	Other Receivables
	
INVENTORIES	
Materials	
151	Raw Materials Inventory
152	Work-In-Process Inventory
153	Finished Goods Inventory
154	Merchandise Inventory
Supplies	
155	Office Supplies Inventory
156	Accountable Forms Inventory
157	Animal/Zoological Supplies Inventory
158	Food Supplies Inventory
159	Drugs and Medicines Inventory
160	Medical, Dental and Laboratory Supplies Inventory
161	Gasoline, Oil and Lubricants Inventory
162	Agricultural Supplies Inventory
163	Textbooks and Instructional Materials Inventory
164	Military and Police Supplies Inventory
165	Other Supplies Inventory
166	Confiscated/Abandoned/Seized Goods Inventory
167	Spare Parts Inventory
168	Construction Materials Inventory
Agricultural, Fishery and Forestry Products	
169	Livestock Inventory
170	Crops and Fruits Inventory
176	Other Agricultural, Fishery and Forestry Products Inventory
PREPAYMENTS	
177	Prepaid Rent	
178	Prepaid Insurance	
179	Prepaid Interest	
180	Deposit on Letters of Credit	
181	Advances to Contractors	
182	Deferred Charges	
185	Other Prepaid Expenses	
OTHER CURRENT ASSETS	
186	Guaranty Deposits	
189	Other Current Assets	
	
INVESTMENTS	
INVESTMENTS IN SECURITIES	
191	Investments in Treasury Bills	
192	Investments in Stocks	
193	Investments in Bonds	
197	Other Investments and Marketable Securities	
SINKING FUND	
198	Sinking Fund	
	
PROPERTY, PLANT AND EQUIPMENT	
LAND AND LAND IMPROVEMENTS	
201	Land	
202	Land Improvements	
302	Accumulated Depreciation - Land Improvements
203	Runways/Taxiways	
303	Accumulated Depreciation - Runways/Taxiways
204	Railways	
304	Accumulated Depreciation - Railways
205	Electrification, Power and Energy Structures	
305	Accumulated Depreciation - Electrification, Power and Energy        Structures
	
ppe_BUILDINGS	
211	Office Buildings	
311	Accumulated Depreciation - Office Buildings
212	School Buildings	
312	Accumulated Depreciation - School Buildings
213	Hospitals and Health Centers 	
313	Accumulated Depreciation - Hospitals and Health Centers
214	Markets and Slaughterhouses 	
314	Accumulated Depreciation - Markets and Slaughterhouses
215	Other Structures	
315	Accumulated Depreciation - Other Structures
	
ppe_LEASEHOLD IMPROVEMENTS	
218	Leasehold Improvements, Land	
318	Accumulated Depreciation - Leasehold Improvements, Land
219	Leasehold Improvements, Buildings	
319	Accumulated Depreciation - Leasehold Improvements, Buildings
220	Other Leasehold Improvements	
320	Accumulated Depreciation - Other Leasehold Improvements
	
ppe_OFFICE EQUIPMENT, FURNITURE AND FIXTURES	
221	Office Equipment	
321	Accumulated Depreciation - Office Equipment
222	Furniture and Fixtures 	
322	Accumulated Depreciation - Furniture and Fixtures
223	IT Equipment and Software 	
323	Accumulated Depreciation - IT Equipment
224	Library Books	
324	Accumulated Depreciation - Library Books
	
ppe_MACHINERIES AND EQUIPMENT	
226	Machineries	
326	Accumulated Depreciation - Machineries
227	Agricultural, Fishery and Forestry Equipment	
327	Accumulated Depreciation - Agricultural, Fishery and Forestry  Equipment
228	Airport Equipment	
328	Accumulated Depreciation - Airport Equipment
229	Communication Equipment	
329	Accumulated Depreciation - Communication Equipment
230	Construction and Heavy Equipment	
330	Accumulated Depreciation - Construction and Heavy Equipment
231	Firefighting Equipment and Accessories	
331	Accumulated Depreciation - Firefighting Equipment and Accessories
232	Hospital Equipment	
332	Accumulated Depreciation - Hospital Equipment
233	Medical, Dental and Laboratory Equipment	
333	Accumulated Depreciation - Medical, Dental and Laboratory  Equipment
234	Military and Police Equipment	
334	Accumulated Depreciation - Military and Police Equipment
235	Sports Equipment	
335	Accumulated Depreciation - Sports Equipment
236	Technical and Scientific Equipment	
336	Accumulated Depreciation - Technical and Scientific Equipment
240	Other Machineries and Equipment	
340	Accumulated Depreciation - Other Machineries and Equipment
	
ppe_TRANSPORTATION EQUIPMENT	
241	Motor Vehicles	
341	Accumulated Depreciation - Motor Vehicles
242	Trains	
342	Accumulated Depreciation - Trains
243	Aircraft and Aircraft Ground Equipment 	
343	Accumulated Depreciation - Aircraft and Aircraft Ground Equipment
244	Watercrafts	
344	Accumulated Depreciation - Watercrafts
248	Other Transportation Equipment	
348	Accumulated Depreciation - Other Transportation Equipment
	
ppe_OTHER PROPERTY, PLANT AND EQUIPMENT	
250	Other Property, Plant and Equipment	
350	Accumulated Depreciation - Other Property, Plant and Equipment	
	
ppe_PUBLIC INFRASTRUCTURES	
251	Roads, Highways and Bridges 	
252	Parks, Plazas and Monuments	
253	Ports, Lighthouses and Harbors	
254	Artesian Wells, Reservoirs, Pumping Stations and Conduits	
255	Irrigation, Canals and Laterals	
256	Flood Controls	
257	Waterways, Aqueducts, Seawalls, River Walls and Others	
260	Other Public Infrastructures	
	
ppe_REFORESTATION PROJECTS	
261	Reforestation - Upland	
262	Reforestation - Marshland/Swampland	
	
CONSTRUCTION IN PROGRESS	
Agency Assets	
264	Construction in Progress - Agency Assets	
Public Infrastructures/Reforestation Projects	
266	Construction in Progress - Roads, Highways and Bridges	
267	Construction in Progress - Parks, Plazas and Monuments	
268	Construction in Progress - Ports, Lighthouses and Harbors	
269	Construction in Progress - Artesian Wells, Reservoirs, Pumping        Stations and Conduits	
270	Construction in Progress - Irrigation, Canals and Laterals	
271	Construction in Progress - Flood Controls	
272	Construction in Progress - Waterways, Aqueducts, Seawalls, River        Walls and Others	
273	Construction in Progress - Other Public Infrastructures	
274	Construction in Progress - Reforestation - Upland	
275	Construction in Progress - Reforestation - Marshland/Swampland	
	
OTHER ASSETS	
281	Work/Other Animals	
282	Breeding Stocks	
283	Arts, Archeological Specimen and Other Exhibits	
284	Items in Transit	
290	Other Assets	
	
	
	
";

$liability="
LIABILITIES	
	
CURRENT LIABILITIES	
Payable Accounts	
401	Accounts Payable	
402	Notes Payable	
403	Due to Officers and Employees	
409	Interest Payable	
Inter - Agency Payables	
411	Due to National Treasury	
412	Due to BIR	
413	Due to GSIS	
414	Due to PAG-IBIG	
415	Due to PHILHEALTH	
416	Due to Other NGAs	
417	Due to Other GOCCs	
418	Due to LGUs	
Intra - Agency Payables	
421	Due to Central Office	
422	Due to Regional Offices/Staff Bureaus	
423	Due to Operating Units	
424	Due to Other Funds	
Other Liability Accounts	
426	Guaranty Deposits Payable	
427	Performance/Bidders/Bail Bonds Payable	
428	Currency Swap Payable	
429	Tax Refunds Payable	
439	Other Payables	
	
LONG - TERM LIABILITIES	
Mortgage/Bonds/Loans Payable	
441	Mortgage Payable	
442	Bonds Payable - Domestic	
443	Bonds Payable - Foreign	
444	Loans Payable - Domestic	
445	Loans Payable - Foreign	
450	Other Long - Term Liabilities	
	
DEFERRED CREDITS	
451	Deferred Real Property Tax Income	
452	Deferred Special Education Tax Income	
455	Other Deferred Credits	
";
$capital="
EQUITY	
	
GOVERNMENT EQUITY	
501	Government Equity	
	
INTERMEDIATE ACCOUNTS	
511	Cost of Goods Sold	
512	Income and Expense Summary	
513	Retained Operating Surplus (Year 1)	
514	Retained Operating Surplus (Year 2)	
515	Retained Operating Surplus (Year 3)	
";
$income="
INCOME	
TAX REVENUE	
National Taxes	
551	Business Tax	
552	Capital Gain Tax	
553	Documentary Stamp Tax	
554	Donors Tax	
555	Estate Tax	
556	Excise Tax on Articles	
557	Final Tax	
558	Franchise Tax	
559	Immigration Tax	
560	Import Duties	
561	Income Tax - Individuals	
562	Income Tax - Partnerships	
563	Income Tax - Corporations	
564	Professional Tax	
565	Stock Transfer Tax	
566	Tax on Forest Products	
567	Value Added Tax	
568	Value Added Tax - Expanded	
578	Other National Taxes	
579	Fines and Penalties - National Taxes	
	
Local Taxes	
581	Amusement Tax	
582	Business Tax	
583	Community Tax	
584	Franchise Tax	
585	Occupation Tax	
586	Printing and Publication Tax	
587	Property Transfer Tax	
588	Real Property Tax	
589	Real Property Tax on Idle Lands	
590	Special Assessment Tax	
591	Special Education Tax	
592	Tax on Delivery Trucks and Vans	
593	Tax on Sand, Gravel and Other Quarry Products	
598	Other Local Taxes	
599	Fines and Penalties - Local Taxes	
	
GENERAL INCOME ACCOUNTS	
Permits and Licenses	
601	Fees on Weights and Measures	
602	Fishery Rental Fees 	
603	Franchising and Licensing Fees	
604	Motor Vehicles Users Charge	
605	Permit Fees	
606	Registration Fees	
608	Other Permits and Licenses	
609	Fines and Penalties - Permits and Licenses	
	
Service Income	
611	Affiliation Fees	
612	Athletic and Cultural Fees	
613	Clearance and Certification Fees	
614	Comprehensive Examination Fees	
615	Diploma and Graduation Fees	
616	Garbage Fees	
617	Inspection Fees	
618	Library Fees	
619	Medical, Dental and Laboratory Fees	
620	Passport and Visa Fees	
621	Processing Fees	
622	Seminar Fees 	
623	Toll and Terminal Fees	
624	Transcript of Records Fees	
628	Other Service Income	
629	Fines and Penalties - Service Income	
	
Business Income	
631	Hospital Fees	
632	Income from Canteen Operations	
633	Income from Cemetery Operations	
634	Income from Communication Facilities	
635	Income from Dormitory Operations	
636	Income from Markets	
637	Income from Slaughterhouses	
638	Income from Transportation Systems	
639	Income from Waterworks Systems	
640	Landing and Parking Fees	
641	Printing and Publication Income	
642	Rent Income	
643	Sales Revenue	
644	Tuition Fees	
648	Other Business Income	
649	Fines and Penalties - Business Income 	
	
Subsidy Income	
651	Subsidy Income from National Government	
652	Subsidy from other National Government Agencies	
653	Subsidy from Central Office	
654	Subsidy from Regional Office/Staff Bureau	
655	Subsidy from Operating Unit	
656	Subsidy from Other LGUs	
657	Subsidy from Other Funds	
	
Other Income	
661	Dividend Income	
662	Income from Grants and Donations	
663	Insurance Income	
664	Interest Income	
665	Internal Revenue Allotment	
666	Sale of Confiscated/Abandoned/Seized Goods and Properties	
667	Share from Economic Zones	
668	Share from Expanded Value Added Tax (EVAT)	
669	Share from National Wealth	
670	Share from PAGCOR/PCSO	
671	Share from Tobacco Excise Tax	
678	Miscellaneous Income	
679	Other Fines and Penalties	
	
GAIN/LOSS ACCOUNTS	
	
681	Gain/Loss on Foreign Exchange (FOREX)	
682	Gain/Loss on Sale of Disposed Assets	
683	Gain/Loss on Sale of Securities	
684	Prior Years' Adjustments	
";
$expense="
EXPENSES 	
	
PERSONAL SERVICES	
Salaries and Wages	
701	Salaries and Wages - Regular	
702	Salaries and Wages - Military/Uniformed	
703	Salaries and Wages - Part-time	
704	Salaries and Wages - Substitute	
705	Salaries and Wages - Casual	
706	Salaries and Wages - Contractual	
707	Salaries and Wages - Emergency	
Other Compensation	
711	Personnel Economic Relief Allowance ( PERA)	
712	Additional Compensation ( ADCOM)	
713	Representation Allowance (RA)	
714	Transportation Allowance (TA)	
715	Clothing/Uniform Allowance	
716	Subsistence, Laundry and Quarter Allowance	
717	Productivity Incentive Allowance	
718	Overseas Allowance	
719	Other Bonuses and Allowances	
720	Honoraria	
721	Hazard Pay	
722	Longevity Pay	
723	Overtime and Night Pay	
724	Cash Gift	
725	Year End Bonus	
Personnel Benefits Contributions	
731	Life and Retirement Insurance Contributions	
732	PAG-IBIG Contributions	
733	PHILHEALTH Contributions	
734	ECC Contributions	
Other Personnel Benefits	
738	Pension Benefits - Civilian	
739	Pension Benefits - Military/Uniformed	
740	Retirement Benefits - Civilian	
741	Retirement Benefits - Military/Uniformed	
742	Terminal Leave Benefits	
743	Health Workers Benefits	
749	Other Personnel Benefits	
	
MAINTENANCE AND OTHER OPERATING EXPENSES	
Traveling Expenses	
751	Traveling Expenses - Local	
752	Traveling Expenses - Foreign	
Training and Scholarship Expenses	
753	Training Expenses	
754	Scholarship Expenses	
Supplies and Materials Expenses	
755	Office Supplies Expenses	
756	Accountable Forms Expenses	
757	Animal/Zoological Supplies Expenses	
758	Food Supplies Expenses	
759	Drugs and Medicines Expenses	
760	Medical, Dental and Laboratory Supplies Expenses	
761	Gasoline, Oil and Lubricants Expenses	
762	Agricultural Supplies Expenses	
763	Textbooks and Instructional Materials Expenses	
764	Military and Police Supplies Expenses	
765	Other Supplies Expenses	
Utility Expenses	
766	Water Expenses	
767	Electricity Expenses	
768	Cooking Gas Expenses	
Communication Expenses	
771	Postage and Deliveries	
772	Telephone Expenses - Landline	
773	Telephone Expenses - Mobile	
774	Internet Expenses	
775	Cable, Satellite, Telegraph, and Radio Expenses	
778	Membership Dues and Contributions to Organizations	
779	Awards and Indemnities	
780	Advertising Expenses	
781	Printing and Binding Expenses	
782	Rent Expenses	
783	Representation Expenses	
784	Transportation and Delivery Expenses	
785	Storage Expenses	
786	Subscriptions Expenses	
787	Survey Expenses	
788	Rewards and Other Claims	
Professional Services	
791	Legal Services	
792	Auditing Services	
793	Consultancy Services	
794	Environment/Sanitary Services	
795	General Services	
796	Janitorial Services	
797	Security Services	
799	Other Professional Services	
Repairs and Maintenance	
rm_Land Improvements	
802	Repairs and Maintenance - Land Improvements	
803	Repairs and Maintenance - Runways/Taxiways	
804	Repairs and Maintenance - Railways	
805	Repairs and Maintenance - Electrification, Power and Energy Structures	
rm_Buildings	
811	Repairs and Maintenance - Office Buildings	
812	Repairs and Maintenance - School Buildings	
813	Repairs and Maintenance - Hospitals and Health Centers	
814	Repairs and Maintenance - Markets and Slaughterhouses	
815	Repairs and Maintenance - Other Structures	
rm_Leasehold Improvements	
818	Repairs and Maintenance - Leasehold Improvements, Land	
819	Repairs and Maintenance - Leasehold Improvements, Buildings	
820	Repairs and Maintenance - Other Leasehold Improvements	
rm_Office Equipment, Furniture and Fixtures	
821	Repairs and Maintenance - Office Equipment	
822	Repairs and Maintenance - Furniture and Fixtures	
823	Repairs and Maintenance - IT Equipment and Software	
rm_Machineries and Equipment	
826	Repairs and Maintenance - Machineries	
827	Repairs and Maintenance - Agricultural, Fishery and Forestry Equipment	
828	Repairs and Maintenance - Airport Equipment	
829	Repairs and Maintenance - Communication Equipment	
830	Repairs and Maintenance - Construction and Heavy Equipment	
831	Repairs and Maintenance - Firefighting Equipment and Accessories	
832	Repairs and Maintenance - Hospital Equipment	
833	Repairs and Maintenance - Medical, Dental and Laboratory Equipment	
834	Repairs and Maintenance - Military and Police Equipment	
835	Repairs and Maintenance - Sports Equipment	
836	Repairs and Maintenance - Technical and Scientific Equipment	
840	Repairs and Maintenance - Other Machineries and Equipment	
rm_Transportation Equipment	
841	Repairs and Maintenance - Motor Vehicles	
842	Repairs and Maintenance - Trains	
843	Repairs and Maintenance - Aircraft and Aircraft Ground Equipment	
844	Repairs and Maintenance - Watercrafts	
848	Repairs and Maintenance - Other Transportation Equipment	
rm_Other Property, Plant and Equipment	
850	Repairs and Maintenance - Other Property, Plant and Equipment	
rm_Public Infrastructures	
851	Repairs and Maintenance - Roads, Highways and Bridges	
852	Repairs and Maintenance - Parks, Plazas and Monuments	
853	Repairs and Maintenance - Ports, Lighthouses and Harbors	
854	Repairs and Maintenance - Artesian Wells, Reservoirs, Pumping       Stations and Conduits	
855	Repairs and Maintenance - Irrigation, Canals and Laterals	
856	Repairs and Maintenance - Flood Controls	
857	Repairs and Maintenance - Waterways, Aqueducts, Seawalls,       Riverwalls and Others	
860	Repairs and Maintenance - Other Public Infrastructures	
rm_Reforestation Projects	
861	Repairs and Maintenance - Reforestation - Upland	
862	Repairs and Maintenance - Reforestation - Marshland/Swampland	
	
Subsidies and Donations	
871	Subsidy to National Government Agencies	
872	Subsidy to Regional Offices/Staff Bureaus	
873	Subsidy to Operating Units	
874	Subsidy to Local Government Units	
875	Subsidy to Government Owned and Controlled Corporations	
876	Subsidy to NGOs/POs	
877	Subsidy to Other Funds	
878	Donations	
Confidential, Intelligence, Extraordinary and Miscellaneous Expenses	
881	Confidential Expenses	
882	Intelligence Expenses	
883	Extraordinary Expenses	
884	Miscellaneous Expenses	
Taxes, Insurance Premiums and Other Fees	
891	Taxes, Duties and Licenses	
892	Fidelity Bond Premiums	
893	Insurance Expenses	
Non-Cash Expenses	
Bad Debts	
901	Bad Debts Expense	
Depreciation	
d_Land Improvements	
902	Depreciation - Land Improvements	
903	Depreciation - Runways/Taxiways	
904	Depreciation - Railways	
905	Depreciation - Electrification, Power and Energy Structures	
d_Buildings	
911	Depreciation - Office Buildings	
912	Depreciation - School Buildings	
913	Depreciation - Hospitals and Health Centers	
914	Depreciation - Markets and Slaughterhouses	
915	Depreciation - Other Structures	
d_Leasehold Improvements	
918	Depreciation - Leasehold Improvements, Land	
919	Depreciation - Leasehold Improvements, Buildings	
920	Depreciation - Other Leasehold Improvements	
d_Office Equipment, Furniture and Fixtures	
921	Depreciation - Office Equipment	
922	Depreciation - Furniture and Fixtures	
923	Depreciation - IT Equipment	
924	Depreciation - Library Books	
d_Machineries and Equipment	
926	Depreciation -Machineries 	
927	Depreciation - Agricultural, Fishery and Forestry Equipment	
928	Depreciation - Airport Equipment	
929	Depreciation - Communication Equipment	
930	Depreciation - Construction and Heavy Equipment	
931	Depreciation - Firefighting Equipment and Accessories	
932	Depreciation - Hospital Equipment	
933	Depreciation - Medical, Dental and Laboratory Equipment	
934	Depreciation - Military and Police Equipment	
935	Depreciation - Sports Equipment	
936	Depreciation - Technical and Scientific Equipment	
940	Depreciation - Other Machineries and Equipment	
d_Transportation Equipment	
941	Depreciation - Motor Vehicles	
942	Depreciation - Trains	
943	Depreciation - Aircraft and Aircraft Ground Equipment	
944	Depreciation - Watercrafts	
948	Depreciation - Other Transportation Equipment	
d_Other Property, Plant and Equipment	
950	Depreciation - Other Property, Plant and Equipment	
depletion
951	Depletion	
Obsolescence - IT Software	
	
Discounts	
954	Discount on Real Property Taxes	
955	Discount on Special Education Tax	
	
Tax Exemptions and Refunds	
957	Loss from Tax Exemptions	
958	Tax Refunds	
	
Remittance to National Treasury from Assets Disposal	
959	Remittance to National Treasury from Assets Disposal	
	
Other Maintenance and Operating Expenses	
961	Loss of Assets	
962	Loss on Guaranty	
969	Other Maintenance and Operating Expenses	
	
FINANCIAL EXPENSES	
971	Bank Charges	
972	Commitment Fees	
973	Debt Service Subsidy to GOCCs	
974	Documentary Stamps Expenses	
975	Interest Expenses	
979	Other Financial Charges	
";

$accode="";
$string=$asset;
$string=str_replace("","",$string);
$array=explode("\n",$string);
foreach($array as &$item)
{
  $item=trim($item);
  if(!$item)continue;
  $pieces=explode("\t",$item);
  $code=$pieces[0];//substr($item,-4,3);
  if(isset($pieces[1]))
  {
    $name=$pieces[1];//substr($item,2,strlen($item)-8);
  }
  $at="at_asset";
  if($code>0)
  {

    //echo "<br>"."-";
    showaccount2($name,$code,$at,$accode);
    if(!array_key_exists($accode,$codearray))
      echo $name." --------- ".$accode."<br>";
  }
  else
    //echo "<br>".$code;
    $accode=strtolower(str_replace(array(",","-"," ","/"),"",$code));
}

$string=$liability;
$string=str_replace("","",$string);
$array=explode("\n",$string);
foreach($array as &$item)
{
  $item=trim($item);
  if(!$item)continue;
  $pieces=explode("\t",$item);
  $code=$pieces[0];//substr($item,-4,3);
  if(isset($pieces[1]))
  {
    $name=$pieces[1];//substr($item,2,strlen($item)-8);
  }
  $at="at_liability";
  if($code>0)
  {

    //echo "<br>"."-";
    showaccount2($name,$code,$at,$accode);
    if(!array_key_exists($accode,$codearray))
      echo $name." --------- ".$accode."<br>";
  }
  else
    //echo "<br>".$code;
    $accode=strtolower(str_replace(array(",","-"," ","/"),"",$code));
}

$string=$capital;
$string=str_replace("","",$string);
$array=explode("\n",$string);
foreach($array as &$item)
{
  $item=trim($item);
  if(!$item)continue;
  $pieces=explode("\t",$item);
  $code=$pieces[0];//substr($item,-4,3);
  if(isset($pieces[1]))
  {
    $name=$pieces[1];//substr($item,2,strlen($item)-8);
  }
  $at="at_equity";
  if($code>0)
  {

    //echo "<br>"."-";
    showaccount2($name,$code,$at,$accode);
    if(!array_key_exists($accode,$codearray))
      echo $name." --------- ".$accode."<br>";
  }
  else
    //echo "<br>".$code;
    $accode=strtolower(str_replace(array(",","-"," ","/"),"",$code));
}

$string=$income;
$string=str_replace("","",$string);
$array=explode("\n",$string);
foreach($array as &$item)
{
  $item=trim($item);
  if(!$item)continue;

  $pieces=explode("\t",$item);
  $code=$pieces[0];//substr($item,-4,3);
  if(isset($pieces[1]))
  {
    $name=$pieces[1];//substr($item,2,strlen($item)-8);
  }
  $at="at_income";
  if($code>0)
  {

    //echo "<br>"."-";
    showaccount2($name,$code,$at,$accode);
    if(!array_key_exists($accode,$codearray))
      echo $name." --------- ".$accode."<br>";
  }
  else
    //echo "<br>".$code;
    $accode=strtolower(str_replace(array(",","-"," ","/"),"",$code));
}

$string=$expense;
$string=str_replace("","",$string);
$array=explode("\n",$string);
foreach($array as &$item)
{
  $item=trim($item);
  if(!$item)continue;

  $pieces=explode("\t",$item);
  $code=$pieces[0];//substr($item,-4,3);
  if(isset($pieces[1]))
  {
    $name=$pieces[1];//substr($item,2,strlen($item)-8);
  }
  $at="at_expense";
  if($code>0)
  {

    //echo "<br>"."-";
    showaccount2($name,$code,$at,$accode);
    if(!array_key_exists($accode,$codearray))
      echo $name." --------- ".$accode."<br>";
  }
  else
    //echo "<br>".$code;
    $accode=strtolower(str_replace(array(",","-"," ","/"),"",$code));
}


